home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 24 / AACD 24.iso / AACD / Online / Epic4 / share / epic / help / 6_functions / pattern < prev    next >
Text File  |  2001-03-21  |  1KB  |  29 lines

  1. Synopsis:
  2.    $pattern(<pattern> <word list>)
  3.    $rpattern(<word> <pattern list))
  4.  
  5. Technical:
  6.    The $pattern() function is used to reduce a list of words to only those
  7.    matching the given pattern.  It is paired with $rpattern(), which does
  8.    exactly the opposite, matching a word to a list of patterns.  If no
  9.    matches are found, an empty string is returned.
  10.  
  11. Practical:
  12.    These functions are similar to $match() and $rmatch(), except that they
  13.    return a list of all matches, not just an index to the best match.  This
  14.    is useful when you know that more than one item may match, and you want
  15.    to see all matches, not just the best.
  16.  
  17. Returns:
  18.    list of matching words/patterns, or empty string if none match
  19.  
  20. Examples:
  21.    $pattern(*oo* foobar blah booya)       returns "foobar booya"
  22.    $pattern(*a* hello there bob)          returns nothing
  23.    $rpattern(booya *oo* b* *erf)          returns "*oo* b*"
  24.    $rpattern(booya *u* foo* *bar)         returns nothing
  25.  
  26. See Also:
  27.    filter(6); match(6); rfilter(6); rmatch(6)
  28.  
  29.